package social.hub.google.buzz;

import static org.junit.Assert.*;

import java.util.List;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class ITBuzzClientImpl {

	private BuzzClientImpl client;

	@Before
	public void setUp() throws Exception {

		final String apiKey = "www.amigon.com.br";
		final String apiSecret = "43iELZZbcbn/m3lWpUQIZljA";
		final String accessToken = "1/EFOkUj06LjsA1Arychzuh7d3_Uo9UhvadlkbUXEtbnA";
		final String accessTokenSecret = "GQieB2mD1BTUirhLX0peC6G5";

		client = new BuzzClientImpl(apiKey, apiSecret, accessToken, accessTokenSecret);

	}

	@After
	public void tearDown() throws Exception {
	}

	@Test
	public void testGetFollowers() {

		int esperado = 14;

		final List<BuzzProfile> friends = client.getFollowers();

		assertEquals(esperado, friends.size());

	}

	@Test
	public void testGetFollowersString() {

		String profileId = "116384691390256548142";
		int esperado = 13;

		final List<BuzzProfile> friends = client.getFollowers(profileId);

		assertEquals(esperado, friends.size());

	}

	@Test
	public void testGetUserProfile() {

		String esperado = "116871695689627378204";

		final BuzzProfile user = client.getUserProfile();

		assertEquals(esperado, user.getId());

	}

	@Test
	public void testGetUserProfileLong() {

		String profileId = "116871695689627378204";

		final BuzzProfile user = client.getUserProfile(profileId);

		assertEquals(profileId, user.getId());

	}

	@Test
	public void testCreateAtivity() {
		client.createAtivity("Teste Integração Buzz");
	}

}
